﻿using System.ComponentModel.DataAnnotations;
using SqlSugar;
using StudyCompanion.Core.Models;

namespace StudyCompanion.Entity.System;

/// <summary>
///     登录日志
/// </summary>
[SugarTable("sys_login_log")]
public class LoginLog : BaseEntity
{
    /// <summary>
    ///     用户ID
    /// </summary>
    public long UserId { get; set; }

    /// <summary>
    ///     IP地址
    /// </summary>
    public virtual string? IPAddress { get; set; }

    /// <summary>
    ///     浏览器
    /// </summary>
    [MaxLength(100)]
    public virtual string? Browser { get; set; }

    /// <summary>
    ///     操作系统
    /// </summary>
    [MaxLength(100)]
    public virtual string? OS { get; set; }


    /// <summary>
    ///     创建时间
    /// </summary>
    [SugarColumn(IsOnlyIgnoreInsert = true)]
    public DateTime CreateTime { get; set; }
}